perm filename TMP[0,BGB]1 blob sn#048497 filedate 1973-12-22 generic text, type T, neo UTF8
COMMENT ⊗   VALID 00014 PAGES 
RECORD PAGE   DESCRIPTION
 00001 00001
 00005 00002	\\M1NGB25\F1\.
 00008 00003	DO <function> | DO <program> | DO
 00015 00004	PARK
 00019 00005	OPEN <dist>
 00021 00006	FREE <n> <f1> ... <fn>
 00024 00007	CONO <arrive> <depart> <k> <ts> <tm> <weight>
 00027 00008	SAVE <id>
 00029 00009	JUMP <label>
 00033 00010	LINK <n>
 00034 00011	DEFINE <macro name> <par>
 00037 00012	\JThis is a programming example. We have the situation of the hand holding
 00042 00013	ERRORS
 00044 00014	RUNNING THE ARM
 00048 ENDMK
⊗;
\\M1NGB25;\F1\.
GENERAL
\JThe arm has six degrees of freedom corresponding to 6 joints. The joints
are numbered from 1 to 6 starting at the shoulder and moving out to the hand.
All rotary joint angles are measured in degrees. Joint 3 which is linear
is measured in inches.

The coordinate system is referenced to the table top with the table lying in
the x y plane at z=0 with the z axis pointing vertically up.
The origin is at the corner of the table. The base of the arm is at 20,10 approximately.

The Arm is normally controlled by specifying what happens to the hand. The program
checks that the hand will not intersect the table.

On the finger tips are two touch sensors which can interrupt arm operation.\.

The program which runs the arm is in the form of an interpreter and works in two
basic modes: Planning and Execution.
In the planning mode arm functions are assembled into a data file which may then
be executed by a "DO" command. Functions may be immediately executed by prefixing
the function call by "DO". For example.\.

	OPEN 3
	PARK
	DO

\Jwill cause a data file to be constructed, either on the 3330 as a file WAVE.TRJ or on
the Swapping disk, containing the two functions open the hand to 3 inches and then
move to the park position. These two commands are then executed by the DO.\.

	DO OPEN 3
	DO PARK

\JThis will have the same effect except that the planning program will be activated
between each function call, which is very time consumming.

It is possible to write symbolic programs either in the form of macros using the
"DEFINE" pseudo op, or by creating a text file and reading it in by a "REQUIRE"
pseudo op.

What follows is a list of the Functions, Errors and how to run the arm.\.


DO <function> | DO <program> | DO
\JIf DO is followed by a function then that function will be executed.
This does not change the state of any program being compiled.
Otherwise the <id> following the DO is taken as the program name.
If DO is terminated by a C/R then the default program is executed.
If this does not exist the servo will return an error status 3.
The default program name is that last set by FILE this is changed by DOing another program,
in which case its program name becomes the default, or by a BEGIN pseudo op.\.

REQUIRE <file spec>
\JThis causes the input scanner to read from the designated file. When an EOF is
encountered scan returns to the TTY.
<file spec>::= <file name>.<ext>[pppn]
where if <ext> is null then HAL is used and if [pppn] is missing the running pppn is
assumed.\.

DUMP <file spec>
\JThis causes a file to be opened and all transforms, vectors and macros are written 
out in symbolic form. It is the opposite to REQUIRE.
If a file already exists, of the same name, it is over-written!!!\.

TRANS <id>
<X> <Y> <Z> <O> <A> <T>
\JThis pseudo op is on two lines and is used to set up a 4x4 transformation and to
identify it with an <id>. The <X> <Y> and <Z> specify the position of a point
centrally located between the finger tips in table coordinates. <O> <A> and <T>
specify the orientation of the hand. with all three angles (in degrees) zero the
hand points in the  negative "y" direction with the fingers in a horizontal plane.
the orientation vector which points from one finger tip to the other is aligned
along the "x" axis. <O> specifies a rotation of the orientation vector about a
vertical direction; thus at <O>=90 degrees the hand still horizontal would point
along the positive "x" direction. <A> is a rotation about the orientation vector.
With <A>=90 degrees the hand always points straight down. <T> is a final rotation
about the axis of the wrist and corresponds to a rotation of the final joint.
When talking to the interpreter directly from the TTY only as many parameters that
have changed need to be retyped. Further a delimiter (which includes a space)
indicates that the parameter is to remain unchanged. For example to change the
<Z> parameter only one types\.
TRANS <id>
<space><space><Z>C/R.

VECT <id>
<X> <Y> <Z>
This is similar to TRANS except that it sets up vectors.

BEGIN <id>
\JThis pseudo op starts a program of name <id>. If this pseudo op is not given
before any instruction then a default BEGIN <default name> is automatically
generated.\.

END
\JThis closes files and deletes any save and restore cell assignments, if a program
has not been ENDed before a DO <program> is executed an automatic END is performed
but in this case the save and restore cell assignments are not lost.\.

WAIT
\JCauses the arm to stop at the corresponding point during execution. Execution may
be resumed (after executing any number of functions) by a proceed command.\.

P <integer>
\Jthis causes the arm to proceed from a wait or an error state, if the argument is
non zero execution proceeds with the last or current instruction, otherwise from
the next instruction.\.

FILE <id>
This changes the default file name to <id>. It is initially set at WAVE.

WHERE
\JThis causes the arm's position to be read and the position to be typed out.
This function is automatically executed when the program is started. It should only
be executed if the arm has been moved manually.\.

HERE <id>
\JThis is like TRANS except that the hands position is read as in WHERE to give
the initial position for the transform <id>. Its main use is in defining positions
by moving the hand and then creating a transform to represent the present position.\.

PARK
\JGenerates a trajectory to the PARK position, which has joint angles
-180, -90, 14, -90, 90, 0\.

GO <trans> | GO <trans> <dx> <fac> <axis> <deg>
\JGenerates a three part trajectory to either <trans> or in the second case
to <trans> rotated about a vector <axis>, <deg> degrees and translated an
additional vector <dx> scaled by <fac>.
There are three predeclared vectors about which the hand may be rotated:
TWIST the axis of the hand, TURN normal to the plane of the fingers and
TILT the axis through the fingers.
In the case of the translation vector there are similarly three predeclared
vectors: REACH in the direction of the fingers, SWEEP in the direction from
finger tip to finger tip and
LIFT in the direction of the normal to the plane of the fingers.
These predeclared vectors, all of magnitude 1, are in the hand coordinate
system not in the table coordinate system which makes them useful for relative motion.\.

MOVE <trans> | MOVE <trans> <dx> <fac> <axis> <deg>
\JThis is the same as GO except that a smooth trajectory is fitted through the
three positions.\.

DRAW <pos> <rot> <angle> <crank> <axis> <deg> <time> <loop>
\JThis is a controlled motion of the hand. The hand is moved to its present position
plus the vector <pos>. As it moves the hand is rotated about a vector <rot>, <angle>
degrees. If <crank> is not null then the hand is assumed to be attached to a crank
which is the initial position + <crank> and as the first motion is executed the
hand attached to the end of the crank is rotated about an axis <axis> <deg> degrees.
If loop is non zero and the initial and final positions are the same the loop motion
may be repeated continuously <loop> times. The entire motion takes <time> jiffies.
A jiffy is 1/60 th. second.\.

CHANGE <dx> <fac> <rot> <deg> <time>
\JThis causes a differential motion of vector <dx> scaled by <fac> and simultaneously
the hand rotated about a vector <rot>, <deg> degrees. The motion shall take no less
than <time> jiffies.\.

DRIVE <joint> <dist> <time>
\JThis causes joint <joint>(1 is the root joint -- 6 is the hand) to be driven <dist>
degrees, or in the case of joint 3 ---inches, in a minimum time <time>. All other joints
brakes remain on unless free joints are also specified.\.

PLACE
This causes the hand to move down until it meets some resistance.
OPEN <dist>
\JThis causes the hand to be opened or closed until the opening between the fingers
is <dist>, it gives up after about 4 seconds and returns error 22 if it is unable to
comply.\.

CLOSE <dist>
\JThis always closes the hand until it meets some resistance. It then checks that
the opening of the hand is greater than <dist>. If it is less it returns error 2.
This is useful in checking that the hand is holding something.\.

CENTER <dist>
\JThis is the same as CLOSE except that the hand is driven to close centrally over
the object using touch.\.

SCREW <vel>
\JThis instruction will drive the tool at velocity <vel> (maximum =63). It must
be MERGEd with some arm motion.\.
i.e.
	SCREW 27
	MERGE
	CHANGE REACH 1 NIL 0 100
\JWhile the hand reaches one inch the tool will drive at velocity 27. Normally
FREE joints would also be specified together with some STOPping constraint.
Note NIL, of zero value, is the only other predeclared vector.\.

FREE <n> <f1> ... <fn>
\JFor each of the <n> direction vectors <fn> joints of the arm are freed
during the next arm motion.
These joints have gravity compensation, additional forces and acceleration
compensation but no position sensitive feedback.
The vectors <fn> specify directions in table coordinates.\.

For example.

	VECT X
	1 0 0
	VECT Y
	0 1 0
	FREE 2 X Y
	CHANGE REACH 1 NIL 0 100

Would provide for free motion in the x and y direction while the hand reaches 1 inch
for the next 100 jiffies.

SPIN <n> <f1> ... <fn>
\JFor each of the <n> axis vectors <fn> joints of the arm are freed as in FREE.\.

FORCE <fv> <mv>
\JDuring the next arm motion additional predicted joint torques will be applied
such as to exert a force <fv> and moment <mv> at the hand.\.

For example.

	VECT Z
	0 0 -1
	FREE 1 Z
	VECT F
	0 0 -50
	FORCE F NIL
	CHANGE NIL 0 NIL 0 100

This would provide for a direction of free motion in the z direction while exerting
a force of 50 oz. straight down. i.e. the hand will push down at 50 oz foe the next
100 jiffies.

STOP <fv> <mv>
\JIf during the next arm motion the force and moment at the hand exceed <fv> and <mv>
the arm will stop. If such a condition is not meet during the motion an error 23
will be returned.\.

WOBBLE <deg>
\JThis causes the outer three joints to be modulated with a sine wave of amplitude
<deg> degrees.\.

NNUL
\JAt the end of the next motion do not wait to null out joint errors but stop
the arm immediately.\.




CONO <arrive> <depart> <k> <ts> <tm> <weight>
\JThis function executed immediately before any motion instruction is used to modify
the performance of that motion. All motions start at an initial position
move to a position given by initial + <depart> where <depart> is a vector which
is always restored to 0,0,3 after each motion instruction. The arm then moves
to a position given by final + <arrive> where arrive is similar to <depart>, and
then to the final position. In the case of PARK <arrive> is set to null. 
A vector <k> is used to specify the radii of gyration of the object held in the hand.
the x axis is along the direction normal to the plane of the fingers. the y direction
is along the direction of the orientation vector (between the finger tips). and the
z direction is along the fingers. The weight of the object is given in <weight> in
ounces. <ts> is the minimum time in jiffies (1/60 second) for the initial and final
parts of the trajectory, and <tm> is the minimum time for the mid part. non zero times are used to
slow down arm motions.\.

MERGE
\JThis function if executed before a motion instruction causes the instruction
before the motion instruction to be executed with the motion. This is only
useful with OPEN if it is desired to open the hand as it moves off.\.
i.e
	OPEN 3
	MERGE
	MOVE T
will cause the hand to start opening as the arm starts to move.

TOUCH <mask>
\JThis causes the arm to stop during the next instruction if any of the masked touch
sensors in <mask> are activated.\.
i.e.
	TOUCH 3
	OPEN 0
\Jwill cause the hand to close until it touches something.
If it touches anything an error <mask>&6 is returned where <mask> are those sensors
which have been activated.\.

SAVE <id>
\JThe current deviation in x,y and z from the set point is saved in cell <id>.
for example if the hand were move to a position T and then CENTERed the 
deviation of position of the hand from T, after the centering operation can be saved in <id>\.
i.e.
	MOVE T
	CENTER 1
	SAVE C1
Note that this does not save any change in hand orientation.

SET <id> <vect>
\JThis will preload cell <id> with the deviation x,y,z in vector <vect>.\.

RESTORE <id> <int>
\JThis instruction must be executed immediately after a MOVE or GO instruction
and will cause the hand to move to the position specified plus the deviation.
SAVEd in cell <id>. If <int> is non zero the cell will be freed for further use.\.
i.e.
	MOVE T
	RESTORE C1 1
\Jwill cause the hand to move to T plus the vector SAVEd in C1.
It will also free up C1 for further use.\.

JUMP <label>
\JAll instructions may be labelled by a label followed by a colon, and the JUMP
instruction will cause control to jump to that instruction.\.
i.e.
L1:	MOVE T
	PARK
	JUMP L1
will cause an infinite loop.

SKIPE <error>
\JIf error <error> occurs during execution on the previous instruction then
the following instruction is skipped.\.
i.e.
L1:	OPEN 3
	CHANGE REACH 1 NIL 0 0
	CLOSE 1
	SKIPE 2
	JUMP L2
	JUMP L1
L2:
will cause the hand to advance by inches snapping its jaws until it finds something
wider than 1 inch.

SKIPN <error>
\JThe same as SKIPE except that it skips only if the error did not occur. Which makes
the last example cleaner.\.
L1:	OPEN 3
	CHANGE REACH 1 NIL 0 0
	CLOSE 1
	SKIPN 2
	JUMP L1

SKIPS <error>
\JThis is like SKIPE in that the right octal digit of the error must match exactly
but it also requires that the logical AND of the high order digits with <error>
is true. This is mostly used in touch work. For example if either error 46 or 
error 16 would indicate some state then a SKIPS 56 would detect it.\.

AOJ <label>
\JThis is the same as JUMP except that it will perform a spiral box search as follows.
A SEARCH command must have first been executed to calculate the differential joint
angle changes to make an x deviation and a y deviation at the place that the search
must be executed. Then every time the AOJ instruction is executed it first performs
a RESTORE of appropriate magnitude to generate the spiral and then performs the JUMP.\.
i.e.
	MOVE T
	SEARCH 1
L1:	MOVE T
	AOJ L1
\JWill cause a spiral search in one inch steps. The first move to T is important
as the context for the SEARCH must be established.\.

SEARCH <step>
\JComputes the change in joint angles to conduct a search, in the x,y plane, where the arm is currently
planned to be and zeros the AOJ counters.\.

FLUSH
\JDue to the partial paging scheme used by the arm, Jumps must occur within pages
This instruction will cause a new page to be started. This will soon go away.\.

LINK <n>
\JWill cause the transformation of link  <n> ( 3 ≤ n ≤6) to be typed out.\.

GRASP
Causes the current hand opening to be typed out.

WEIGHT
\JCauses the uncompensated weight that the hand is believed to be holding,
based on error torques, to be typed out.\.

I
Causes the joint angles to be typed out.
DEFINE <macro name> <par>
<body>
\JThis defines a macro of name <macro name> and formal parameters given by <par>
a list of identifiers.
The body then follows,line by line.
The macro is terminated by a blank line.
macros may be nested. An example\.
DEFINE GRAB MIN
MOVE T
CLOSE MIN

If the macro call appears then the expanded code will be assembled.
	GRAB 2
will assemble as
	MOVE T
	CLOSE 2
\JThese macros are written out by the DUMP command and are read in by the REQUIRE command.\.

ED <macro name>
\JThis is a rudementary editor.
The <macro name> must be given the first time but need not be gived again if the same
macro is to be re-edited.
The macro definition is then presented line by line every time a C/R is typed.
Previous lines may be retrieved by typing ALT.\.
	A "D" will delete the current line
	An "I" will insert a line after the present line, to be typed in.
	An "R" will replace the current line with one to be typed in.
	A "T" will cause the next line to be typed.
\JAll these commands may be preceded by an unsigned integer which will do n of them.
For example 5D will delete the current and next 4 lines.
When you have finished editing the macro type "E" then the macro
will be read in again and redefined. (assuming that the first line which
has the DEFINE is not deleted. This by the way is a good way to modify existing
macros if the macro name is changed  a new macro will be defined.
One additional feature is
"F" followed SOS manner by a string. It will then do a series of C/Rs until
a line with a matching string is found.\.
\JThis is a programming example. We have the situation of the hand holding
the screw driver which has a screw on its end. We want to insert the screw
into a hole and to screw it all the way in.\.
\←R\-L\/'2;\+L\→M\.
	DEFINE	SCRW	H A		\←M\→.;The macro to screw the screw into hole H using
					\←M\→.;approach A
	VECT SA				\←M\→.;The departure vector from the screw dispenser
	0 -1 2
	VECT SCK			\←M\→.;The radii of gyration of the screw driver
	.5 1.0 1.0
	CONO A SA SCK 10 40 50		\←M\→.;Set up the conditions for the move
	FIND H H 1			\←M\→.;A nested macro call to perform the search
	VECT FV				\←M\→.;The force to verify that it is in the hole
	0 0 -60
	STOP FV NIL			\←M\→.;Stop during the next motion
	CHANGE REACH .7 NIL 0 0		\←M\→.;If the arm goes .7 inch then we are not
					\←M\→.;in the hole and the arm will stop with
					\←M\→.;error 23
	FREE 3 X Y Z			\←M\→.;X, Y and Z are vectors in the x, y and z
					\←M\→.;directions. This will specify three degrees
					\←M\→.;of freedom.
	VECT FV				\←M\→.;We will wnat to push down with this force
	0 0 -60
	FORCE FV NIL			\←M\→.;Push with force FV
	VECT MV				\←M\→.;This is the stopping moment
	0 0 -100
	STOP NIL MV			\←M\→.;Stop when we meet it.
	SCREW 60			\←M\→.;Drive the screw driver at this velocity
	MERGE				\←M\→.;while
	CHANGE NIL 0 NIL 0 100		\←M\→.;we go nowhere while pushing down, with three
					\←M\→.;free joints, monitoring the torque.
L1:	FREE 2 X Y			\←M\→.;The screw is now in and we must pull the
					\←M\→.;screw driver out. We want two degrees of fredom.
	WOBBLE .2			\←M\→.;Shake things around a bit
	CHANGE REACH -.2 NIL 0 0	\←M\→.;while we go up 0.2 inches
	VECT FV				\←M\→.;Set up a force
	0 0 100
	STOP FV NIL			\←M\→.;and stop if it is exceeded during the next
					\←M\→.;motion, indicating that the driver is jammed
					\←M\→.;in the screw.
	NNUL				\←M\→.;dont null errors
	CHANGE Z 1 NIL 0 50		\←M\→.;and try to go up an inch.
	SKIPE 23			\←M\→.;this means that the stopping force of 100 oz
					\←M\→.;was not meet and all is O.K.
	JUMP L1				\←M\→.;if not try again
	CONO SA A SCK 10 0 0		\←M\→.;Set up the return conditions
	GO SC				\←M\→.;and go back to the screw dispenser.




	DEFINE	FIND	T D F		\←M\→.;This macro is used to search for the hole
					\←M\→.;The hole is at Trans T offset by a vector D
					\←M\→.;scaled by F
	NNUL				\←M\→.;dont null the first time
	GO T D F NIL 0			\←M\→.;Go to the hole position
	VECT FV				\←M\→.;Maximum resistance that the screw will meet
	0 0 -50
	SEARCH .07			\←M\→.;Set up for a search of 0.7 in steps.
					\←M\→.;Note that the context for the search has been
					\←M\→.;established by the previous GO.
	CONO NIL NIL SCK 10 0 0		\←M\→.;No arrive or depart, move directly
L1:	GO T D F NIL 0			\←M\→.;The search move
	STOP FV NIL			\←M\→.;Try to go down
	NNUL				\←M\→.;without nulling
	CHANGE REACH .6 NIL 0 60	\←M\→.;by 0.6 inches
	SKIPE 23			\←M\→.;if we meet resistance then not in hole
	AOJ L1				\←M\→.;spiral and try again

ERRORS
This is a list of the error messages you might get when running the arm.
When running wave the error message corresponding to the error is typed.

	1	Arithmetic Overflow occured. Something bad has happened.
	<n>1	Excessive force occured at joint <n>
	2	Hand closed more than minimum specified in CLOSE function
	3	File not found
	4	Someone has pawned the DSK
	5	Someone has sold the DSK
	<mask>6	Touch sensors <mask> have touched something
	7	Cannot read the joint positions, usually hardware trouble.
	20	Function took too long to execute
	22	Hand function took too long to execute.
	23	Arm failed to reach force limit set by STOP during motion.
	24	Arm in L1: JUMP L1 type loop.
	25	Save array number out of bound
	27	The function you have called is disconnected.
	30	The arm is down
	50	Librascope read error
	60	You have a very old program which does not match the current servo
	70	The reference supply used by the arm is off.
	100	The PDP6 is not running.
	200	The servo program has been interrupted.


RUNNING THE ARM
\JPower to the arm is controlled by a switch on a box with two lights. The box
is located on the rack under the table near the base of the arm. The yellow
light indicated that the power supply is on and the red light indicated that
the arm is also on.

There is also a grey box on the end of a cable with some switches and a →→→"RED BUTTON"←←←
on it. The buttons are brake releases. The one furthest from the →→→"RED BUTTON"←←←
is joint 1. There is no brake release for joint 6, sorry about that. The last
switch is the hand brake release. All brakes should be turned on when the arm is
being run.

Now for the →→→"RED BUTTON"←←←. If the →→→"RED BUTTON"←←← is pushed while the
arm is running the arm will stop and all brakes will be applied. You should always
be holding the box with your finger over the →→→"RED BUTTON"←←← when running the arm.
For damaging the hand ... -6 acamedic credits. For damaging the arm ... -12 acamedic credits.

There is also a bell that starts 1 second before the arm does 
in the case of a DO and starts with the arm in the case of a P.
The bell goes "ting, ting, ting," just like a truck backing-up, except that
someone stole the bell, oh well!\.

RUNNING THE PROGRAM
The program is on 1,3 and is run by typing
R WAVE
\JThis program will in turn log in a servo program as a PTY job, and will
run a job called [ARM].
When this job is running you will be asked if you want your files saved.
If you respond Y then the arm programs will be written out on the 3330 with
.TRJ extensions. These files may be executed at a later time by simply
 saying DO followed by the file name(with no extension).
If you do not ask to have your files saved fast bands will be used which although
fast will all disappear when you kill your job.

Wave will then announce that it is ready and you can type anything on the previous
pages. 
It will respond with O.K. when it has been supplied all the parameters for the 
function you are defining.
It will then respond with an * when ready for the next function.
Sometimes in execution the servo program will cause trouble.
If it is in the run queue  but not in spacewar mode then someone has the A/D assigned
If it is in the stop queue then you will have to ↑c wave and restart, which will
lose all your macros and data unless you have dumped it.\.